//
//  MSSearchResultCell.m
//  MSJD
//
//  Created by 箭军刘 on 2018/10/13.
//  Copyright © 2018年 xiangbo. All rights reserved.
//

#import "MSSearchResultCell.h"

#import "MSStarControl.h"

@interface MSSearchResultCell()

@property (weak, nonatomic) IBOutlet UIImageView *resultIcon; // 搜索结果Icon
@property (weak, nonatomic) IBOutlet UILabel *resultTitleLabel; // 搜索结果标题标签
@property (weak, nonatomic) IBOutlet UILabel *resultInfoLabel; // 搜索结果信息标签
@property (weak, nonatomic) IBOutlet UIView *resultStarLevelLabel; // 搜索结果星级标签
@property (weak, nonatomic) IBOutlet UILabel *resultReviewsCountLabel; // 搜索结果评论次数

@property (nonatomic, strong) MSStarControl *starControl;

@end

@implementation MSSearchResultCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)refreshSearchResultCellWithContentDic:(NSDictionary *)contentDic {
    
    if (!self.starControl) {
        self.starControl = [[MSStarControl alloc] initWithFrame:CGRectMake(0.f, 0.f, 80.f, 12) numberOfStars:5 image:@"star_favorite11" foreColor:nil backColor:nil];
        [self.resultStarLevelLabel addSubview:self.starControl];
        [self.starControl mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.left.bottom.right.offset(0);
        }];
    }
    
    self.starControl.scorePercent = 4.5;
    
    
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
